#!/bin/sh
if [ ! -d ./pubkeys ]
then
mkdir pubkeys
fi
for i in $*
do
echo "generating key pair for $i"
openssl genrsa -out $i@cernvm-messaging.cern.ch.priv.pem
echo "extracting public key from $i's private key"
openssl rsa -in $i@cernvm-messaging.cern.ch.priv.pem -pubout -out ./pubkeys/$i@cernvm-messaging.cern.ch.pub.pem
done
